/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package apus.action.organization;

import apus.action.Action;
import apus.action.ActionResult;
import apus.entity.Organization;
import apus.persistence.OrganizationDAO;
import apus.services.ServiceLocator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author 21vek
 */
public class OrganizationListAction implements Action{

    @Override
    public String getName() {
        return "organization.list";
    }

    @Override
    public ActionResult execute(HttpServletRequest request, HttpServletResponse response) {
        List <Organization> organizationList = ServiceLocator.getService(OrganizationDAO.class).findAll();
        request.setAttribute("organizationList", organizationList);
        return ActionResult.forward("/WEB-INF/View/OrganizationView/OrganizationListView.jsp");
    }
    
}
